﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using Microsoft.Samples.ServiceHosting.AspProviders;
using Microsoft.CloudSaver.Web.Infrastructure;
using System.Web.Routing;

namespace Microsoft.CloudSaver.Web
{
    public class Global : System.Web.HttpApplication
    {

        void Application_Start(object sender, EventArgs e)
        {
            
        }

        private void RegisterRoutes(RouteCollection routeCollection)
        {
            //Add your custom code to map routes in CloudSaver. Everything in the web.config is already set up.
        }

        void Application_End(object sender, EventArgs e)
        {
            //  Code that runs on application shutdown
        }

        void Application_Error(object sender, EventArgs e)
        {
            // Code that runs when an unhandled error occurs
        }

        void Session_Start(object sender, EventArgs e)
        {
            //Each new session blobs and table are checked; settings too.
            CloudUtils.CreateBlobContainers();
            CloudUtils.SetupDefaultBlobs();
            CloudUtils.CreateCloudTables();
            CloudUtils.CreateDefaultCredentials();
        }

        void Session_End(object sender, EventArgs e)
        {
            
        }

    }
}
